#include "DThread.h"

D_ThreadPool *CreateNewThreadPool(GFunc func,gpointer UserData,gint max_threads, GError **error){
    D_ThreadPool *thread_pool = g_thread_pool_new(func,UserData,max_threads,TRUE,*error);
    if(thread_pool == NULL){
        g_message("%s",Error("ThreadPool Created Error"));
        exit(EXIT_FAILURE);
    }
    return thread_pool;
}

D_ThreadObj *NewThreadCreate(const gchar *name,GThreadFunc func,gpointer data){
    D_ThreadObj *thread = g_thread_new(name,func,data);
    if(thread == NULL){
        g_message("%s",Error("NewThreadCreate Error"));
        exit(EXIT_FAILURE);
    }
    return thread;
}
